package com.ly.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ly.system.entity.TbDepartment;
import com.ly.system.entity.TbUser;
import com.ly.system.mapper.TbDepartmentMapper;
import com.ly.system.service.TbDepartmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.system.vo.TbDepartmentVO;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author jiangzhu
 * @since 2020-10-31
 */
@Service
public class TbDepartmentServiceImpl extends ServiceImpl<TbDepartmentMapper, TbDepartment> implements TbDepartmentService
{

    @Resource
    TbDepartmentMapper tbDepartmentMapper;

    @Override
    public List<TbDepartmentVO> findDeptAndCount() {
        return tbDepartmentMapper.findDeptAndCount();
    }

    @Override
   public IPage<TbDepartment> findDeptAndCount22(Page<TbUser> page, @Param(Constants.WRAPPER) QueryWrapper<TbDepartment> queryWrapper){
        return tbDepartmentMapper.findDeptAndCount2(page,queryWrapper);
    }
}
